﻿using ChronoScript_Compiler.Language;
using ChronoScript_Compiler.Language.Parser;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChronoScript_Compiler
{
    class Program
    {
        static void Main(string[] args)
        {
            //string code = "void test(int i){ }";
            Lexer lexer = new Lexer();
            CodeGen.CodeGen.Assembler = new Viper.Assembly();
            CodeGen.CodeGen codegen = new CodeGen.CodeGen();
            StringReader sr = new StringReader(File.ReadAllText("test.txt"));
            lexer.Scan(sr);
            Parser parser = new Parser(lexer.tokens);
            parser.Parse();
            codegen.BeginGeneration(parser.AST);
            CodeGen.CodeGen.Assembler.SaveGEX("test.gex");
            Console.ReadLine();
        }
    }
}
